<?php 
       # Include FusionCharts PHP Class
           include('Charts/Class/FusionCharts_Gen.php');

       # Create Column3D chart Object 
           $FC = new FusionCharts("Column3D","600","350"); 
          # set the relative path of the SWF file
          $FC->setSWFPath("Charts/FusionCharts/");
          #  Set chart attributes
          $strParam="caption=Letter Count Analysis;xAxisName=Letter;yAxisName=Count;numberPrefix=";
          $FC->setChartParams($strParam);
          # add chart values and  category names
//           $FC->addChartData("40800","label=Week 1");
//           $FC->addChartData("31400","label=Week 2");
//           $FC->addChartData("26700","label=Week 3");
//           $FC->addChartData("54400","label=Week 4");
     
                    	//Strip the string
        $str = $text1;
		$new_string = strtolower(ereg_replace("[^A-Za-z]", "", $str ));
	
		foreach (count_chars($new_string, 1) as $i => $val) {
			$tmp = "label=".chr($i);
			$FC->addChartData($val,$tmp);
   			//echo "There were $val instance(s) of \"" , chr($i) , "\" in the string.\n";
		};
      ?>
        <html>
          <head>
            <title>Letter Count Analysis</title>
            <script language='javascript' src='Charts/FusionCharts/FusionCharts.js'></script>
          </head>
          <body>
        <?php
            # Render Chart 
            $FC->renderChart();
          ?>
        </body>
   </html>